<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义对象的原型设置</title>
</head>
<body>
    <script>
        let hd = {name : "后盾人"};
        let hdms = {
            name : "后盾人网站",
            show:function(){
                console.log(this.name)
            }
        };

        // 设置原型(hdms是hd的原型)
        Object.setPrototypeOf(hd,hdms);
        console.log(hd);

        // show方法里的this，谁调用就指向谁
        hd.show();
        hdms.show();


        // 获取原型的方法
       console.log( Object.getPrototypeOf(hd));

    </script>
</body>
</html>